package com.delegate.pattern.delegate;

import com.delegate.pattern.service.EmployeeService;
import com.delegate.pattern.service.impl.EmployeeServiceImplA;
import com.delegate.pattern.service.impl.EmployeeServiceImplB;

import java.util.HashMap;
import java.util.Map;

/**
 * @author cc
 * @classname Leader
 * @description 委派者
 * @date 2022/3/27 15:28
 */
public class Leader implements EmployeeService {

    private Map<String, EmployeeService> targets = new HashMap<>();

    public Leader() {
        targets.put("招聘开发", new EmployeeServiceImplA());
        targets.put("招聘产品", new EmployeeServiceImplB());
    }

    //自己不干活
    @Override
    public void doing(String command) {
        targets.get(command).doing(command);
    }

}
